package com.ssd.controller.inner;

import com.ssd.api.product.ProductSkuApi;
import com.ssd.api.product.dto.SkuEntity;
import com.ssd.service.OrderService;
import com.ssd.service.SkuService;

import com.ssd.view.BaseResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RequestMapping("/inner/sku")
@RestController
@Api(tags = "内部接口 - 商品相关接口")
public class ProductSkuApiController implements ProductSkuApi {
    @Resource
    private SkuService skuService;

    @GetMapping("/skuById")
    @ApiOperation("远程调用测试")
    public BaseResponse<SkuEntity> getSkuById1(Long sukId) {
        return skuService.getSkuById(sukId);
    }

    @GetMapping("/skuListByIds")
    @Override
    //根据商品id列表查询商品列表
    public BaseResponse<List<SkuEntity>> getSkuListByIds(List<Long> skuIds) {
        return new BaseResponse(skuService.getSkusByIds(skuIds));
    }
}
